package com.hbnu;

public class Flower {
    private int id;
    private String name;
    private String type;
    private double price;
    private int stock;
    private String description;
    private int soldCount;

    public Flower(int id, String name, String type, double price, int stock, String description, int soldCount) {
        this.id = id;
        this.name = name;
        this.type = type;
        this.price = price;
        this.stock = stock;
        this.description = description;
        this.soldCount = soldCount;
    }

    public Flower(String name, String type, double price, int stock, String description) {
        this.name = name;
        this.type = type;
        this.price = price;
        this.stock = stock;
        this.description = description;
    }

    // Getters and Setters
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public String getType() { return type; }
    public void setType(String type) { this.type = type; }
    public double getPrice() { return price; }
    public void setPrice(double price) { this.price = price; }
    public int getStock() { return stock; }
    public void setStock(int stock) { this.stock = stock; }
    public String getDescription() { return description; }
    public void setDescription(String description) { this.description = description; }
    public int getSoldCount() { return soldCount; }
    public void setSoldCount(int soldCount) { this.soldCount = soldCount; }

    @Override
    public String toString() {
        return String.format("[%d] %s | 类型:%s | ￥%.2f | 库存:%d | 已售:%d | %s",
                id, name, type, price, stock, soldCount, description);
    }
}
